using System;
using System.ComponentModel;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LibreriaWC
{
    [ToolboxData("<{0}:cvExtendido runat=server></{0}:cvExtendido>")]
    public class cvExtendido : System.Web.UI.WebControls.CompareValidator, IValidadorExtendido
	{
        [DefaultValue(typeof(Color), "")]
        [TypeConverter(typeof(WebColorConverter))]
        public virtual Color ColorFondoControl
        {
            get
            {
                return (ViewState["ColorFondoControl"] != null ? (Color)ViewState["ColorFondoControl"] : Color.Empty);
            }
            set
            {
                ViewState["ColorFondoControl"] = value;
            }
        }

        [DefaultValue(typeof(Color), "")]
        [TypeConverter(typeof(WebColorConverter))]
        public virtual Color ColorBordeControl
        {
            get
            {
                return (ViewState["ColorBordeControl"] != null ? (Color)ViewState["ColorBordeControl"] : Color.Empty);
            }
            set
            {
                ViewState["ColorBordeControl"] = value;
            }
        }

        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            ValidadorExtendidoHelper.ActualizarAtributos(this);
            ValidadorExtendidoHelper.RegistrarJavascript(this);
        }
    }
}